import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;

public class Text {
	public static void main(String[] args) throws SQLException{
		
		Query q=new Query();

		//NBAteamBean NBAB=q.QueryAllFromNBAteam(1);
		//System.out.println("teamename="+NBAB.getTeamname());
		//StarinfoBean SB=q.QueryAllFromstarinfo(1);
		//System.out.println("starname="+SB.getStarname());
		//TeaminfoBean TB=q.QueryAllFromteaminfo(1);
		//System.out.println("teaminfo="+TB.getTeaminfo());
		
		ArrayList<NBAteamBean> NBAteamlistbyarea=q.QueryByArea("southwest");
		for(NBAteamBean NBAteambean : NBAteamlistbyarea){
			System.out.println("teamname="+NBAteambean.getTeamname());
		}
		
		//UserBean UB=q.QueryAllFromUserinfo("admin");
		//System.out.println("username="+UB.getUsername());

		//boolean l=Login(q,"xxx","admin");

	}

	public static boolean Login(Query q,String username,String password) throws SQLException {

		UserBean UB=q.QueryAllFromUserinfo(username);
		if(UB.getID()==0){
			System.out.println("False");
			return false;
		}else
		{
			if(UB.getPassword().endsWith(password)){
				System.out.println("True");
				return true;
			}else{
				System.out.println("False");
				return false;
			}
		}
	}
}